<?php
namespace app\api\controller;
use Psr\Log\Logger;

class Test extends Common{
    public function _initialize()
    {
        // todo...
        parent::_initialize();
    }


    // 测试接口
    public function testApi() {
        $type = input('post.type');

        if ($type == '1') {
            $this->outData['data'] = array("PHP");
            $this->outData['code'] = 1;
            $this->outData['message'] = "操作成功";
        } else {
            $this->outData['data'] = array("PHP","JAVA","MYSQL");
            $this->outData['code'] = 1;
            $this->outData['message'] = "操作成功";
        }



        return $this->outData;
    }

    public function index() {
        $logger = new Logger();

        $context = array();
        $context['err'] = "缺少参数id";

        $logger->info("有新消息",$context);
    }


}